
<% /**
	* detectBrowser.jsp
	* 
	* This includes the right css file for a page
	*
	* @author Oren Radousky
	*/
%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   	pageEncoding="ISO-8859-1"%>
<%@page import="b1w1nn1ng.crossf1t.db.*"%>
<%@page import="b1w1nn1ng.crossf1t.gui.*"%>
<%@page import="b1w1nn1ng.crossf1t.business.*"%>

<%
//detect if user is logged in
//boolean isLoggedIn = null;
try {
	User user = (User) session.getAttribute("user");
	session.setAttribute("user", user);
	//request.getParameter();
} catch (Exception e) {
	
}

%>

<%
	String userAgent = request.getHeader("User-Agent");
	boolean isMobile = Utilities.isMobile(userAgent);
	//detect a mobile browser. isMobile returns true for a mobile browser
	/* out.print(isMobile); */
	if(isMobile){
		out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"/crossfit/css/mobile.css\" />");
	} else {
		out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"/crossfit/css/general.css\" />");
	}
%>
